<!--
    My account page
-->
<include target="_header.html" />
<include target="_my_account_sidebar.html" />

<div id="body-content" class="body-two-columns main-content clearfix">
    <h1 class="underline">{$lang->dashboard}</h1>
    <p>{$lang->hello} <!--@if($logged_user->is_site_admin)--><b>{$logged_user->nick_name}</b><!--@else-->{$logged_user->user_name}<!--@end--></p>
    <p>{$lang->my_account_info_text}</p>

    <h2 class="underline">{$lang->recent_orders}</h2>
    <table border="0" cellspacing="0" cellpadding="0" summary="{$lang->content_list}" class="dataTable">
        <thead>
            <tr>
                <th scope="col">Order #</th>
                <th scope="col">Purchased on</th>
                <th scope="col" class="title">Bill to name</th>
                <th scope="col">Total</th>
                <th scope="col">Status</th>
                <th class="a-center" scope="col" width="21%">Actions</th>
            </tr>
        </thead>
        <tbody>
            <tr cond="empty($logged_user->recent_orders)">
                <td class="no-data" colspan="6">
                    <p>{$lang->no_orders}</p>
                </td>
            </tr>
            <!--@foreach($logged_user->recent_orders as $order)-->
            <tr>
                <td>{$order->order_srl}</td>
                <td class="a-center">{zdate($order->regdate)}</td>
                <td class="a-center">{reset(explode(',',$order->billing_address))}</td>

                <td class="a-center">{ShopDisplay::priceFormat($order->total, $shop->getCurrencySymbol())}</td>
                <td class="a-center">{$order->order_status}</td>
                <td class="a-center">
                    <a class="button" title="This will fill your cart with the products existing on this order so you can buy them again" href="{getUrl('','act','dispShopViewOrder','order_srl',$order->order_srl)}">{$lang->read}</a>&nbsp;
                    <a class="button" href="{getUrl('','act','procShopRenewOrder','order_srl',$order->order_srl)}">{$lang->renew}</a>
                </td>
            </tr>
            <!--@end-->
        </tbody>
    </table>

    <h2 class="underline">{$lang->account_info}</h2>
    <!--@if(!$logged_user->is_site_admin)-->
        <p>{$lang->name}: <b>{$logged_user->user_name}</b></p>
    <!--@end-->
    <p>{$lang->nick_name}: <b>{$logged_user->nick_name}</b></p>
    <p>{$lang->email}: <b>{$logged_user->email_address}</b></p>
    <p>
        <a class="button" href="{getUrl('','act','dispMemberModifyPassword')}">{$lang->change_password}</a>
        <a class="button" href="{getUrl('','act','dispMemberModifyInfo')}">{$lang->edit}</a>
    </p>

    <div id="newsletter">
        <h2 class="underline">{$lang->newsletter}</h2>
        <p>Newsletter Information TO DO</p>
        <p>
            <a class="button" href="#">{$lang->edit}</a>
        </p>
    </div>

    <h2 class="underline">{$lang->address_book}</h2>
    <div class="f-left" style="width: 50%">
        <h3>{$lang->default_billing_address}:</h3>
        <p><b>Company:</b> {$logged_user->addresses->default_billing->company}</p>
        <p><b>Telephone:</b> {$logged_user->addresses->default_billing->telephone}</p>
        <p><b>Fax:</b> {$logged_user->addresses->default_billing->fax}</p>
        <p><b>Address:</b> {$logged_user->addresses->default_billing->address}</p>
        <p><b>Additional Info:</b> {$logged_user->addresses->default_billing->additional_info}</p>
        <p><b>City:</b> {$logged_user->addresses->default_billing->city}</p>
        <p><b>Region:</b> {$logged_user->addresses->default_billing->region}</p>
        <p><b>Postal Code:</b> {$logged_user->addresses->default_billing->postal_code}</p>
        <p><b>Country:</b> {$logged_user->addresses->default_billing->country}</p>
        <p>
            <a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$logged_user->addresses->default_shipping->address_srl)}">Edit</a>
        </p>
    </div>

    <div class="f-left" style="width: 50%">
        <h3>{$lang->default_shipping_address}: <b>{$logged_user->addresses->default_shipping_address}</b></h3>
        <p><b>Company:</b> {$logged_user->addresses->default_shipping->company}</p>
        <p><b>Telephone:</b> {$logged_user->addresses->default_shipping->telephone}</p>
        <p><b>Fax:</b> {$logged_user->addresses->default_shipping->fax}</p>
        <p><b>Address:</b> {$logged_user->addresses->default_shipping->address}</p>
        <p><b>Additional Info:</b> {$logged_user->addresses->default_shipping->additional_info}</p>
        <p><b>City:</b> {$logged_user->addresses->default_shipping->city}</p>
        <p><b>Region:</b> {$logged_user->addresses->default_shipping->region}</p>
        <p><b>Postal Code:</b> {$logged_user->addresses->default_shipping->postal_code}</p>
        <p><b>Country:</b> {$logged_user->addresses->default_shipping->country}</p>
        <p><a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$logged_user->addresses->default_shipping->address_srl)}">Edit</a></p>
    </div>

</div>

<include target="_footer.html"/>